<?php
require_once('../phplib/include.inc.php');
require_once('../phplib/util/CheckLogin.inc.php');

class Admin_Modify extends PageBase{
	public function Ini(){
		$a_id = intval(@$_REQUEST['a_id']);
		$db = getDb();
		$re = $db->fetchOne("SELECT * FROM article WHERE a_id=$a_id");
		if(!$re) PageBase::Error("错误，找不到请求的数据");
		$oFCKeditor = new MyFckEditor('content') ;
		$oFCKeditor->Height = 400;
		$oFCKeditor->Value = $re['a_content'];
		$html = $oFCKeditor->CreateHtml();
		$this->assign("editor",$html);
		$this->assign('article',$re);		
		$this->assign('script_article',json_encode($re));		
		$this->GetCategory();
	}
	public function GetCategory(){
		$db = getDb();
		$re = $db->fetch("SELECT * FROM category");
		$this->assign("cats",$re);
	}
}
$a = new Admin_Modify("file:".dirname(__FILE__)."/../admin/modify.tpl.html");
$a->display();
?>